package com.woniuxy.storage.controller;

import com.woniuxy.storage.pojo.Storage;
import com.woniuxy.storage.service.StorageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class StorageController {
    @Autowired
    private StorageService storageService;

    @RequestMapping("/updateNumById/{id}/{count}")
    public boolean updateNumById(@PathVariable("id") Integer id,@PathVariable("count") Integer count){
        return storageService.lambdaUpdate()
                .eq(Storage::getId,id)
                .set(Storage::getCount,count)
                .update();
    }

}
